home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / goldplay.zip / PLAY.ASM < prev    next >
Assembly Source File  |  1993-04-17  |  5KB  |  132 lines

  1. ╓────────────────────────────────────────────────────────────────────────────╖  Comment &
  2. ║                            GoldPlay ver 1.00                               ║
  3. ║────────────────────────────────────────────────────────────────────────────║
  4. ║ Programmed by :                                                            ║
  5. ║             Sourcer of The CodeBlasters                                    ║
  6. ║                                                                            ║
  7. ║ ß-tested and bugfixed by :                                                 ║
  8. ║             Robban of The SkyHawks                                         ║
  9. ╙────────────────────────────────────────────────────────────────────────────╜   &
  10.  
  11. Assume Cs:_Code, Ds:_Data
  12. ─────────────────────────────────────────────────────────────────────────────
  13. _Stack Segment Para Stack 'Stack'
  14.     db 512 dup (?)
  15. _Stack EndS
  16. ─────────────────────────────────────────────────────────────────────────────
  17. ; The Externals
  18. ─────────────────────────────────────────────────────────────────────────────
  19.  
  20. Procedures:
  21.  
  22. EXTRN  INITIALIZE:FAR            ; Initializes the modplayer for given
  23.                                  ; sounddevice and replayrate
  24.  
  25. EXTRN  LOADMODULE:FAR            ; Loads the Module into memory
  26.  
  27. EXTRN  STARTPLAYING:FAR          ; Starts playing the module
  28.  
  29. EXTRN  STOPPLAYING:FAR           ; Stops playing the module
  30.  
  31. EXTRN  DEALLOC:FAR               ; Deallocates and erases the module
  32.                                  ; from memory
  33.  
  34. EXTRN  ASKINIT:FAR
  35.  
  36. Variables:
  37.  
  38. EXTRN  SOUNDDEVICE:WORD          ; The Sounddevice number
  39.  
  40. EXTRN  TIMERSPEED:WORD           ; The replayrate 1193182/Hertz
  41.  
  42. EXTRN  SBDMA:WORD                ; SoundBlaster's DMA-Channel
  43.  
  44. EXTRN  SBIRQNR:WORD              ; SoundBlaster's IRQ-Number
  45.  
  46. Special_Variables:
  47.  
  48. EXTRN  BAR1,BAR2,BAR3,BAR4:WORD  ; Selfdecrementing Bars, see the docs
  49.  
  50. EXTRN  SHOWPATTERNS:Word         ; Shows the patterns
  51.  
  52. EXTRN  MASTERVOLUME:Word         ; Mastervolume from 0 to 64
  53.  
  54. ─────────────────────────────────────────────────────────────────────────────
  55. _Data  Segment Para Public 'Data'
  56.        Filename db 'Digital.mod',0
  57.  
  58.        Error1   Db 13,10,10,7,'Module not found',13,10,'$'
  59.        PlayMess Db 13,10,10,'Playing . . .',13,10
  60.                 Db 'Press ESCAPE to quit$'
  61.  
  62. _Data  EndS
  63.  
  64. ─────────────────────────────────────────────────────────────────────────────
  65. _Code  Segment Para Public 'Code'
  66.  
  67. Proc   Player  Near
  68.        Mov  Ah,4Ah                ; Reduce program memory size
  69.        Mov  Bx,40000/16           ; Approx. size of compiled EXEFILE / 16 + 2
  70.        Int  21h
  71.  
  72.        Mov  Ax,_Data
  73.        Mov  Ds,Ax
  74.  
  75.        Call Askinit              ; Ask for the setup
  76.        Call Initialize           ; Initialize the SoundSystem
  77.  
  78.        Mov  Dx,Offset FileName
  79.        Call Loadmodule           ; Load the module
  80.        Jnc  NoError
  81.  
  82.        Mov  Ah,09h
  83.        Lea  Dx,Error1
  84.        Int  21h                  ; Print the error-message
  85.  
  86.        Mov  Ah,4Ch
  87.        Int  21h                  ; Exit if error...
  88.        NoError:
  89.  
  90.        Mov  Ah,09h
  91.        Lea  Dx,PlayMess
  92.        Int  21h                  ; Show the PLAYING-Message
  93.  
  94.        Call StartPlaying         ; Roll it !
  95.        Mov  Al,01111010b         ; Mask off all unneccesary interrupts.
  96.        Out  21h,Al
  97.  
  98.        WaitEsc:
  99.        In   Al,60h
  100.        Cmp  Al,1
  101.        Jne  WaitEsc              ; Wait until someone presses ESCAPE.
  102.  
  103.        Mov  Al,0                 ; Let the interrupts come again...
  104.        Out  21h,Al
  105.  
  106.        Call StopPlaying          ; Stop the funky music
  107.  
  108.        Call DeAlloc              ; Deallocate the memory for the module
  109.  
  110.        Mov  Ah,4Ch
  111.        Int  21h                  ; Exit to DOS
  112. EndP   Player
  113.  
  114.  
  115. _Code  EndS
  116. ─────────────────────────────────────────────────────────────────────────────
  117.  
  118.        End Player
  119.  
  120. ╓────────────────────────────────────────────────────────────────────────────╖
  121. ║ The Sounddevices:                                                          ║
  122. ║────────────────────────────────────────────────────────────────────────────║
  123. ║                        01  Soundplayer/Covox at LPT1  (Mono)               ║
  124. ║                        02  Soundplayer/Covox at LPT2  (Mono)               ║
  125. ║                        03  SoundBlaster               (Mono)               ║
  126. ║                        04  Internal Honker            (Mono)               ║
  127. ║                        05  Two Soundplayers LPT1+2    (Stereo)             ║
  128. ║                        06  SoundBlaster Pro           (Stereo)             ║
  129. ║                        07  Stereo SoundPlayer in LPT1 (Stereo)             ║
  130. ║                        08  Stereo SoundPlayer in LPT2 (Stereo)             ║
  131. ╙────────────────────────────────────────────────────────────────────────────╜
  132.